package day24.zuoye1;

import java.io.File;
import java.io.FileReader;
import java.io.FileWriter;
import java.io.IOException;

public class Ioextest {
    public static void main(String[] args) {
        File file=new File("D:\\java io");
        if (!(file.exists())){
            file.mkdir();
        }
        File file1=new File("D:\\java io\\io.txt");
        if (!(file1.exists())){
            try{
                file1.createNewFile();
            }catch (IOException e){
                e.printStackTrace();
            }
            if (file1.exists()){
                File file2=new File("D:\\java io");
                File file3=new File(file1.getParent()+File.separator+file2.getName());
                if(file1.renameTo(file3)){
                    System.out.println("文件复制成功");
                }
            }
        }
    }
}
